//class ObjEventListerTool
    
    export  class ObjEventListerTool
    {
       

        public static addObjEvent(arg1: Object /* flash.events.IEventDispatcher */, arg2: string, arg3: Function, arg4: Boolean): void
        {
            var loc2=null;
            if (!ObjEventListerTool.hasObjEvent(arg1)) 
            {
                ObjEventListerTool.dicObjEvents[arg1] = [];
            }
            var loc1=ObjEventListerTool.dicObjEvents[arg1];
            var loc3=0;
            var loc4=loc1;
            for(loc2 of loc4) 
            {
                if (!(loc2.type == arg2 && loc2.listener == arg3 && loc2.useCapture == arg4)) 
                {
                    continue;
                }
                return;
            }
            loc2 = new LisObj(arg2, arg3, arg4);
            loc1.push(loc2);
            return;
        }

        public static hasObjEvent(arg1: Object /* flash.events.IEventDispatcher */): Boolean
        {
            return !(ObjEventListerTool.dicObjEvents[arg1] == null) && !(ObjEventListerTool.dicObjEvents[arg1] == undefined);
        }

        public static removeObjEvent(arg1: Object /* flash.events.IEventDispatcher */, arg2: string, arg3: Function, arg4: Boolean): void
        {
            var loc1=null;
            var loc2=0;
            var loc3=null;
            var loc4=0;
            if (ObjEventListerTool.hasObjEvent(arg1)) 
            {
                loc4 = (loc2 = (loc1 = ObjEventListerTool.dicObjEvents[arg1]).length - 1);
                while (loc4 >= 0) 
                {
                    if ((loc3 = loc1[loc4] as LisObj).type == arg2 && loc3.listener == arg3 && loc3.useCapture == arg4) 
                    {
                        loc1.splice(loc4, 1);
                    }
                    --loc4;
                }
                if (loc1.length == 0) 
                {
                    delete ObjEventListerTool.dicObjEvents[arg1];
                }
            }
            return;
        }

        public static delObjEvent(arg1: Object /* flash.events.IEventDispatcher */): void
        {
            var loc1=null;
            var loc2=null;
            if (ObjEventListerTool.hasObjEvent(arg1)) 
            {
                loc1 = ObjEventListerTool.dicObjEvents[arg1];
                var loc3=0;
                var loc4=loc1;
                for(loc2 of loc4) 
                {
                    arg1.removeEventListener(loc2.type, loc2.listener, loc2.useCapture);
                }
                delete ObjEventListerTool.dicObjEvents[arg1];
            }
            return;
        }

        
        {
            ObjEventListerTool.dicObjEvents = new Map<any, any> /* flash.utils.Dictionary */(true);
        }

        private static /* var */dicObjEvents: Map<any, any> /* flash.utils.Dictionary */;
    }
}


class LisObj
{
    public LisObj(arg1: string, arg2: Function, arg3: Boolean)
    {
        
        this.type = arg1;
        this.listener = arg2;
        this.useCapture = arg3;
        return;
    }

    public /* var */type: string;

    public /* var */listener: Function;

    public /* var */useCapture: Boolean;
